package cn.ds.fly.common;

import cn.ds.fly.modules.sys.entity.FlyUser;
import org.apache.shiro.SecurityUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * Created by lds on 2017/12/14.
 */
public abstract class BaseController {

    protected Logger logger = LoggerFactory.getLogger(getClass());

    protected FlyUser getUser() {
        return (FlyUser) SecurityUtils.getSubject().getPrincipal();
    }

    protected String getUserId() {
        return getUser().getId();
    }

    protected String getDeptId() {
        return getUser().getDeptId();
    }
}
